#ifndef __HTTP__H__
#define __HTTP__H__		1

#ifdef __cplusplus
extern "C" {
#endif

#define DOMAIN_MAXLEN			128
#define FILENAME_MAXLEN			128

typedef struct ST_HTTP
{
	unsigned char domain[DOMAIN_MAXLEN];
	unsigned char ip[16];
	unsigned short port;
	unsigned char filename[FILENAME_MAXLEN];
	
	int fd;
	
	void (*release)(struct ST_HTTP **);
	int (*connect)(struct ST_HTTP *);
	void (*close)(struct ST_HTTP *);
	void (*post_n)(struct ST_HTTP *, unsigned char *, int);
	int (*post)(struct ST_HTTP *, unsigned char *, int, void *arg);
} ST_HTTP_t, *pST_HTTP;

extern pST_HTTP http_init(unsigned char *, int, unsigned char *);

#ifdef __cplusplus
}
#endif

#endif